<template>
	<view class="container">
		<view class="content">
			<view class="none" v-if="result[0].length==0">没有记录</view>
			<block v-for="(item,index) in result[0]" :key="index">
				<view :class="none_order_unit" class="order_unit">
					<view class="nickname">
<!--						<image class="avatar" :src="item.img" v-if="item.img.length>10"></image>-->
<!--						<image class="avatar" :src="static+'/logo.png'" v-else></image>-->
            订单编号：{{item.order_num}}
					</view>
          <block v-for="(v,k) in item.member_list" :key="k">
            <view class="divider"/>
<!--            <view class="order_num">订单编号：{{item.order_num}}</view>-->
            <view class="unit">
              <image class="avatar" :src="v.img" v-if="v.img.length>10"></image>
              <image class="avatar" :src="static+'/logo.png'" v-else></image>
              <view>{{v.nickname}}</view>
              <view class="phone">{{v.phone}}</view>
              <view><text class="member_grade">{{v.grade}}</text></view>
            </view>
          </block>
				</view>
			</block>
		</view>
	</view>
</template>
<style>
	page{background: #F4F4F4;}
	.container{width:100%;}
	.top{width:96%;padding:0 2%;height: 60upx;display: flex;background: #FFFFFF;justify-content: space-between;align-items: center;border-bottom: 1px solid #3de9c7;}
	.balance,.cash{font-size: 26upx;padding-right: 20upx;}
	.cash_submit{background: #3de9c7;border-radius: 10upx;text-align: center;width:25%;font-size: 26upx;color: #FFFFFF;height: 55upx;line-height: 55upx;}
	.nav{width:100%;height: 80upx;background-color:#FFFFFF; display: flex;align-items: center;justify-content: flex-start;flex-wrap: nowrap;}
	.nav_unit{width: 25%;height: 80upx;line-height: 80upx;  font-size: 28upx;text-align: center;}
	.font-color{color: #3de9c7;border-bottom:2px solid #3de9c7;}
	.content{width: 100%;}
	.none{width:100%;height: 80upx;line-height: 80upx;text-align: center;font-size: 28upx;}
	.order_unit{width:92%;margin:20upx 2%;padding:10upx 2%;background:#FFFFFF;}
	.none_order_unit{width:92%;margin:10upx 2%;padding:10upx 2%;background:#E1E1E1;}
	.avatar{width:50upx;height: 50upx;border-radius: 25upx;margin:0 10upx 0 0;}
	.order_num,.nickname{width:100%;font-size: 26upx;line-height: 45upx;}
	.order_num{font-size: 28upx;color: #999999;margin-top: 5upx;}
	.unit{width:100%;display: flex;justify-content: space-between;align-items: center;height: 45upx;margin-top: 5upx;    font-size: 28rpx;}
	.unit_key{font-size: 26upx;font-weight: bold;padding-right:10upx;text-align: center;}
	.unit_value{font-size: 28upx;padding-right:10upx;color: #999999;text-align: center;}
	.unit_value text{font-size:24upx;padding-left:20upx;color: #CCCCCC;}
	.operation{width:20%; text-align: center;}
	.price{font-size: 28upx; text-align: center;color: #ff1844;font-weight: bold;padding-right:10upx;}
	.none_price{font-size: 28upx; text-align: center;color: #FFFFFF;font-weight: bold;padding-right:10upx;}
	.none{width:100%;text-align: center;line-height: 80upx;font-size: 28upx;background: #FFFFFF;}
	.nickname{display: flex;justify-content: flex-start;align-items: center;}
	.grade{padding:8upx 20upx;margin-left:10upx;display:flex;justify-content: flex-start;align-items: center;text-align: center;height: 30upx;line-height:30upx;;border-radius: 20upx;background: #e8c99c;font-size:24upx;}
	.grade image{width:25upx;height:25upx;}
	.n{color: #333333;}
	.title {
		font-size: 16upx;
	}
  .member_grade {
    color:red;
  }
  .divider{
    background: #f0f1f0;
    width: 100%;
    height: 1rpx;
    margin-top: 4px;
    margin-bottom: 10px;
  }
  .phone {
    color:blue;
  }
</style>
<script>
	export default {
		data() {
			return {
				current: 1,
				pic_h:'',
				result:[[],[],[],[]],
				start:[0,0,0,0],
				member:[],
				submit_status:1,
				refresh_status:0,
				switch1:0,
				price:0,
				url: getApp().globalData.url,
				static:getApp().globalData.static
			}
		},
		onLoad(e) {
			var res = uni.getSystemInfoSync();
			var w = res.windowWidth;
			this.pic_h = w*0.92*0.2+"px";
			this.initialize();
		},
		onPullDownRefresh() {
			this.refresh_status = 1;
			this.initialize();
		},
		onReachBottom(){
			this.initialize();
		},
		methods: {
			initialize:function()
			{
				var that = this;
				var member_id = uni.getStorageSync("member_id");
				var st = this.current-1;
				if(this.current==4)
				{
					var type = 6;
				}
				else
				{
					var type = this.current;
				}
				uni.request({
					url: this.url+'/wechat_order_relation',
					data: {member_id:10000,start:this.start[st]},
					header: {'Content-Type': 'application/json'},
					success: (res) => {
						console.log(res);
						if(res.data.status==1)
						{
							that.start[st] += 10;
							for(var k=0;k<res.data.result.length;k++)
							{
								that.result[st].push(res.data.result[k]);

							}

              console.log(res.data.result);
              for (let i = 1;i< that.result.length;i++) {

              }
						}
						if(that.refresh_status==1)
						{
							that.refresh_status = 0;
							uni.stopPullDownRefresh();
						}
					}
				});
			},
			operation:function(e)
			{
				var id = e.currentTarget.id;
				this.current = parseInt(id);
				this.initialize();
			}
		}
	}
</script>


